<?php global $facebook, $user; ?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>DaPadarse</title>
<meta name="keywords" content="">
<meta name="description" content="">
<?php echo Helper::addCss(HTTP_CSS . '/bootstrap.css'); ?>
<?php echo Helper::addCss(HTTP_CSS . '/bootstrap-responsive.css'); ?>
<?php echo Helper::addCss(HTTP_CSS . '/reset.css'); ?>
<?php echo Helper::addCss(HTTP_CSS . '/styles.css'); ?>
<!--[if IE]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
    <body>
        <div id="fb-root"></div>
        <script>
            var TOTAL_TARGETS_PER_USER = <?php echo Dapadarse::TOTAL_TARGETS_PER_USER; ?>;
            window.fbAsyncInit = function() {
                FB.init({
                    appId: '<?php echo isset($facebook) ? $facebook->getAppID() : '' ?>',
                    frictionlessRequests: true,
                    cookie: true,
                    xfbml: true,
                    oauth: true
                });
                FB.Event.subscribe('auth.login', function(response) {
                    window.location.reload();
                });
                FB.Event.subscribe('auth.logout', function(response) {
                    window.location.reload();
                });
            };
            (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
            }());
        </script>
        
       <div class="main">
        <?php if (empty($user)) { ?>
            <div class="warning fullcenter">
                <fb:login-button></fb:login-button>
                <span>Por favor inicia sesion con Facebook para continuar</span>
            </div>
        <?php } ?>